# from PIL import Image
# from PIL.ImageShow import show
#
# filename = r'hsq.png'
#
# img = Image.open(filename)
# size = img.size
#
# print(size)
#
# # # 准备将图片切割成10张小图片
# weight = 192
# height = 1080
#
#
# for i in range(10):
#     box = (weight * i, height * i, weight * (i + 1), height * (i + 1))
#
#     print(box)
#     region = img.crop(box)
#     region1 = region.resize((256,256))
#     region1.save('%s.png' % i)


# import cv2 as cv

# 读取要被切割的图片
# img = cv.imread("./rj.png")
# # 要被切割的开始的像素的高度值
# beH = 0
# # 要被切割的结束的像素的高度值
# hEnd = 28
# # 要被切割的开始的像素的宽度值
# beW = 0
# # 要被切割的结束的像素的宽度值
# wLen = 30
# # 对图片进行切割
# dstImg = img[beH:hEnd, beW:wLen]
# 展示原图
# cv.imshow("img", img)
# # 展示切割好的图片
# cv.imshow("dstImg", dstImg)
#
# cv.imwrite("11.png", dstImg)

# cv.waitKey(0)
# cv.destroyAllWindows()


import pytesseract
from PIL import Image

text =pytesseract.image_to_string(Image.open("./rj.png"),lang="eng")

print(text)

